const { http } = uni.$u
// 微信小程序的一键登录

export const weixinLogin = (params, config = {}) => http.post('app-api/member/auth/weixin-mini-app-login', params, config)
// 获取微信手机号码
export const getWechatMobile = (params, config = {}) => http.post('app-api/member/auth/getWechatMobile', params, config)
// 刷新toke
export const getToken = (params, config = {}) => http.post('app-api/member/auth/refresh-token?refreshToken='+params.refreshToken, params, config)
// 获取用户信息
export const getUserInfo = (data) => http.get('app-api/member/user/get', data)

// 获取知识和活动列表
export const getPageList = (data) => http.get('app-api/content/content/page', data)
// 获取知识和活动列表
export const getPageContent = (data) => http.get('app-api/content/content/get', data)

// 获取获取食物分类列表
export const getFoodcategoryList = (data) => http.get('app-api/weight/food-category/list', data)
// 获取获取食物分类列表
export const getFoodList = (data) => http.get('app-api/weight/food-energy/page', data)
// 获取运动分类列表
export const getExercisecategoryList = (data) => http.get('app-api/weight/exercise-category/list', data)
// 获取获取食物分类列表
export const getExerciseList = (data) => http.get('app-api/weight/exercise-consumption/page', data)
// 获取获取食物分类列表
export const getExerciseListPage = (data) => http.get('app-api/weight/exercise-consumption/list', data)
// 保存个人信息  
export const saveUserinfo = (params, config = {}) => http.put('app-api/weight/body-data/update', params, config)
// 退登
export const logout = (params, config = {}) => http.post('app-api/member/auth/logout', params, config)
// 获取运动计划列表

// 创建运动记录
export const createExerciseRecord = (params, config = {}) => http.post('app-api/weight/exercise-record/create', params, config)
// 更新运动记录
export const updateExerciseRecord = (params, config = {}) => http.put('app-api/weight/exercise-record/update', params, config)
// 删除运动记录
export const deleteExerciseRecord = (params, config = {}) => http.delete('app-api/weight/exercise-record/delete', params, config)
// 获得运动记录
export const getExerciseRecordList = (data) => http.get('app-api/weight/exercise-record/get', data)
// 获得运动记录分页
export const getExerciseRecordPage= (data) => http.get('app-api/weight/exercise-record/page', data)

// 获取食谱列表
export const getRecipePage = (data) => http.get('app-api/weight/recipe/page', data)
// 获取食谱详情
export const getRecipeDetail = (data) => http.get('app-api/weight/recipe/get', data)
// 获取菜单

// 体重记录

export const getweightRecordsAll = (data) => http.get('app-api/weight/body-data/weightRecordsAll', data)
// 添加家庭成员
export const addFamily = (params, config = {}) => http.put('app-api/weight/body-data/addMember', params, config)
// 获取成员列表
export const getFamilyList = (data) => http.get('app-api/weight/body-data/memberList', data)
// 删除成员

export const delFamily = (params, config = {}) => http.delete('app-api/weight/body-data/deleteMember?id='+params.id, params, config)
// 添加体重记录
export const addWeightRecords = (params, config = {}) => http.put('app-api/weight/body-data/addWeightRecords', params, config)
// 体重记录
export const getWeightRecords = (data) => http.get('app-api/weight/body-data/weightRecordsPage',data)
// 趋势列表
export const getTrendList = (data) => http.get('app-api/weight/body-data/trendList',data)

// 获得基本信息
export const getBodyData = (data) => http.get('app-api/weight/body-data/get', data)
// 获得 banner 列表
export const getBannerList = (data) => http.get('app-api/promotion/banner/list', data)
// 获得福利商品分类列表
export const getShopList = (data) => http.get('app-api/promotion/category/list', data)

//开始计划 跟着吃快速开始计划
export const openPlanQuickly = (params, config = {}) => http.post('app-api/weight/member-plan/open-plan-quickly', params, config)
export const getOpenPlanQuickly = (data) => http.get('app-api/weight/member-plan/open-plan-quickly', data)
// 开启计划 通过计划id获取计划 id为空的时候获取最新的计划
export const getPlan = (data) => http.get('app-api/weight/member-plan/get-plan', data)

// 创建饮食记录
export const dietRecordCreate = (params, config = {}) => http.post('app-api/weight/diet-record/create', params, config)
// 更新饮食记录
export const dietRecordUpdate = (params, config = {}) => http.put('app-api/weight/diet-record/update', params, config)
// 删除饮食记录
export const dietRecordDelete = (params, config = {}) => http.delete('app-api/weight/diet-record/delete', params, config)
// 获得饮食记录
export const getdietRecord = (data) => http.get('app-api/weight/diet-record/get', data)
// 获得饮食记录分页
export const getdietRecordPage = (data) => http.get('app-api/weight/diet-record/page', data)
// 获取计划步骤列表
export const getPlanSteps = (data) => http.get('app-api/weight/plan-steps/list', data)
// 生成计划
export const createPlan = (data) => http.get('app-api/weight/member-plan/create-plan', data)
// 开始计划
export const openPlan =  (params, config = {}) => http.post('app-api/weight/member-plan/open-plan', params, config)
// 结束计划
export const closingPlan = (data) => http.get('app-api/weight/member-plan/closing-plan', data)

// 目标推荐
export const targetRecommendation = (data) => http.get('app-api/weight/goal-recommendation/targetRecommendation', data)

// 绑定推广员
export const bindUser = (params, config = {}) => http.put('app-api/trade/brokerage-user/bind', params, config)

// 图片识别食物

export const picturesIdentifyFood = (data) => http.get('app-api/weight/food-energy/picturesIdentifyFood', data)
// 根据字典类型查询字典数据信息
export const getSystemByType = (data) => http.get('app-api/system/dict-data/type', data)

// 获得交易订单分页
export const getOrderPage = (data) => http.get('app-api/trade/sync-order/page', data)

// 推广配置

export const getShareConfig = (data) => http.get('app-api/trade/config/get', data)

// 创建会员分享记录
export const shareCreate =  (params, config = {}) => http.post('app-api/member/share-record/create', params, config)
// 获得会员分享记录
export const getShare = (data) => http.get('app-api/member/share-record/get', data)
// 获得会员分享记录分页
export const getShareList = (data) => http.get('app-api/member/share-record/page', data)


// 上传  file
export const uploadImg = (params, config = {}) => http.post('/api/uploadImg', params, config)

// export const uploadImg = (data) => http.upload('/api/uploadImg', data)


export const uploadFile = (params, config = {}) => http.post('/api/uploadFile', params, config)